package com.book.bookprojectapplication.login.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;

import com.book.bookprojectapplication.R;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		if (getIntent().getStringExtra("key") == null) {
			startActivity(new Intent(this, Loading.class));
		}

		ImageButton loginBtn = (ImageButton) findViewById(R.id.loginBtn);
		loginBtn.setOnClickListener(new ImageButton.OnClickListener() {

			public void onClick(View v) {

				Intent myIntent = new Intent(getApplicationContext(),
						LoginActivity.class);
				startActivity(myIntent);

			}

		});
		ImageButton registerBtn = (ImageButton) findViewById(R.id.registerBtn);
		registerBtn.setOnClickListener(new ImageButton.OnClickListener() {

			public void onClick(View v) {

				Intent myIntent = new Intent(getApplicationContext(),
						RegisterFirstActivity.class);
				startActivity(myIntent);

			}

		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
